Skip to content

Time the copy passes under VerboseLog; narrow their read barrier - #11

Merged
lostsanctuary merged 1 commit into
mainfrom
perf/copy-pass-timing
Oct 18, 2026
Merged

lostsanctuary merged 1 commit into
mainfrom
perf/copy-pass-timing

Conversation

@lostsanctuary

Copy link
Copy Markdown
Owner

What changed

  • Copy-pass GPU timing ([Debug] VerboseLog=1 only):
    • Timestamps: each CopyPass (depth, motion vectors, HUD-less) writes a BOTTOM_OF_PIPE timestamp pair around its copy, in a 4-frame ring. A pair is read back with vkGetQueryPoolResults (no WAIT, so a result that isn't ready is skipped) just before its queries are reused.
    • Log line: every 600 frames, copy passes GPU time: depth … mvec … hudless …; total … us per frame (frame … ms).
    • When off: no query pool is created.
  • Narrower barrier: the barrier after each copy now has COMPUTE_SHADER | TRANSFER as its destination stage, where DLSS-G reads the copies, instead of ALL_COMMANDS. The game's following graphics work no longer waits for our dispatch.
  • Docs:
    • Changelog: a CHANGELOG [Unreleased] entry.
    • Dev log: a docs/DEVELOPMENT.md section with the measurements. This also restores the ## Key risks heading that Run DLSS-G with queue parallelism by default #9 accidentally dropped.
    • Readme: a tools/README.txt note.

Testing

GPU and driver: RTX 5090, driver 616.92, 1080p DLSS Quality, parallel mode

Multipliers tested: 6x for about 90 s with VerboseLog=1; 15 full 600-frame timing windows, 0 fence timeouts.

Pass Average per frame
Depth (1280×720 → R32F) ~12.8 µs
Motion vectors (1280×720 → RG16F) ~10.6 µs
HUD-less (1920×1080 → RGBA8) ~20.7 µs
Total ~44 µs, about 0.5% of the 8.4–9.9 ms frame

The max values of 200–2,100 µs are measurement artifacts from GPU work in between the two timestamps, such as DLSS-G on its own queues. They hit all three passes at random, while the averages stay flat. The barrier change is too small to show in fps.

  • My GPU's highest multiplier in the world (6x)
  • 2x, main menu/map and alt-tab with this build
  • Builds with no warnings
  • Added user-facing changes under ## [Unreleased] in CHANGELOG.md

🤖 Generated with Claude Code

With [Debug] VerboseLog=1 each CopyPass writes a BOTTOM_OF_PIPE timestamp
pair around its copy (4-frame ring, read back without waiting before
reuse), and every 600 frames the log shows the average and max GPU time
per pass and their total against the frame time. No query pool exists
when VerboseLog is off.

The barrier after each copy now waits for COMPUTE_SHADER | TRANSFER (where
DLSS-G reads the copies) instead of ALL_COMMANDS, so the game's following
graphics work doesn't wait for the dispatch.

Measured at 6x on an RTX 5090 (1080p DLSS Quality, parallel mode): depth
~12.8 us, motion vectors ~10.6 us, HUD-less ~20.7 us, ~44 us total, about
0.5% of the frame. Also restores the "Key risks" heading in
docs/DEVELOPMENT.md that the queue-parallelism entry dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lostsanctuary
lostsanctuary enabled auto-merge (squash) October 18, 2026 20:39
@lostsanctuary
lostsanctuary merged commit c617cbc into main Oct 18, 2026
4 checks passed
@lostsanctuary
lostsanctuary deleted the perf/copy-pass-timing branch October 18, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant